Skip to content

feat(apollo_infra_utils): better cairo0 compiler checks#5921

Merged
dorimedini-starkware merged 1 commit into
main-v0.14.0from
04-17-feat_apollo_infra_utils_better_cairo0_compiler_checks
May 26, 2025
Merged

feat(apollo_infra_utils): better cairo0 compiler checks#5921
dorimedini-starkware merged 1 commit into
main-v0.14.0from
04-17-feat_apollo_infra_utils_better_cairo0_compiler_checks

Conversation

@dorimedini-starkware

Copy link
Copy Markdown
Collaborator

No description provided.

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

@github-actions

github-actions Bot commented Apr 17, 2025

Copy link
Copy Markdown

dorimedini-starkware commented Apr 17, 2025

Copy link
Copy Markdown
Collaborator Author

@dorimedini-starkware dorimedini-starkware left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 5 files reviewed, all discussions resolved (waiting on @Itay-Tsabary-Starkware)


crates/apollo_infra_utils/Cargo.toml line 30 at r1 (raw file):

assert-json-diff.workspace = true
cached.workspace = true
colored.workspace = true

this is s bugfix - cargo test -p apollo_infra_utils fails without these deps

Code quote:

assert-json-diff.workspace = true
cached.workspace = true
colored.workspace = true

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 5 files reviewed, all discussions resolved (waiting on @dorimedini-starkware)


crates/apollo_infra_utils/Cargo.toml line 10 at r2 (raw file):

[features]
testing = ["cached", "colored", "dep:assert-json-diff", "socket2", "toml"]

I checked the testing feature dependencies and noticed the inconsistent use of dep: syntax here.
What have we decided regarding this usage?

Code quote:

dep:

@dorimedini-starkware dorimedini-starkware left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 5 files reviewed, all discussions resolved (waiting on @dorimedini-starkware)


crates/apollo_infra_utils/Cargo.toml line 10 at r2 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

I checked the testing feature dependencies and noticed the inconsistent use of dep: syntax here.
What have we decided regarding this usage?

I don't think we decided anything

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 5 files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware)


crates/blockifier_test_utils/src/cairo_compile.rs line 6 at r2 (raw file):

use std::process::{Command, Output};

use apollo_infra_utils::cairo0_compiler::verify_cairo0_compiler_deps;

What's the motivation for having the compiler utilities part of the apollo_infra crate and not in the blockifier test utils crate? Are there other crates that intend to use it?

Code quote:

use apollo_infra_utils::cairo0_compiler::verify_cairo0_compiler_deps;

@dorimedini-starkware dorimedini-starkware left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 5 files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware and @Itay-Tsabary-Starkware)


crates/blockifier_test_utils/src/cairo_compile.rs line 6 at r2 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

What's the motivation for having the compiler utilities part of the apollo_infra crate and not in the blockifier test utils crate? Are there other crates that intend to use it?

yes :)

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 4 of 5 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @dorimedini-starkware)


crates/apollo_infra_utils/Cargo.toml line 10 at r2 (raw file):

Previously, dorimedini-starkware wrote…

I don't think we decided anything

Consider removing the dep: then for consistency. Anyhow, not blocking.

@dorimedini-starkware dorimedini-starkware force-pushed the 04-13-chore_apollo_infra_utils_explicit_instructions_in_verify_cairo0_compiler_deps branch from ed9e2c1 to e099557 Compare April 17, 2025 13:52
@dorimedini-starkware dorimedini-starkware force-pushed the 04-17-feat_apollo_infra_utils_better_cairo0_compiler_checks branch from b461536 to c163a0d Compare April 17, 2025 13:52
@dorimedini-starkware dorimedini-starkware force-pushed the 04-13-chore_apollo_infra_utils_explicit_instructions_in_verify_cairo0_compiler_deps branch from e099557 to bbedc2c Compare April 17, 2025 13:57
@dorimedini-starkware dorimedini-starkware force-pushed the 04-17-feat_apollo_infra_utils_better_cairo0_compiler_checks branch from c163a0d to 83c2706 Compare April 17, 2025 13:57
@github-actions

github-actions Bot commented Apr 17, 2025

Copy link
Copy Markdown

Benchmark movements: No major performance changes detected.

@dorimedini-starkware dorimedini-starkware force-pushed the 04-17-feat_apollo_infra_utils_better_cairo0_compiler_checks branch from a81aec8 to 3165ee8 Compare May 5, 2025 13:09
@dorimedini-starkware dorimedini-starkware force-pushed the 04-13-chore_apollo_infra_utils_explicit_instructions_in_verify_cairo0_compiler_deps branch from 6ed867b to 84ea915 Compare May 6, 2025 12:26
@dorimedini-starkware dorimedini-starkware force-pushed the 04-17-feat_apollo_infra_utils_better_cairo0_compiler_checks branch from 3165ee8 to 761dfbf Compare May 6, 2025 12:26
@dorimedini-starkware dorimedini-starkware force-pushed the 04-17-feat_apollo_infra_utils_better_cairo0_compiler_checks branch from 761dfbf to 6bd0ed0 Compare May 6, 2025 12:36
@dorimedini-starkware dorimedini-starkware force-pushed the 04-13-chore_apollo_infra_utils_explicit_instructions_in_verify_cairo0_compiler_deps branch from 84ea915 to af8f488 Compare May 6, 2025 14:26
@dorimedini-starkware dorimedini-starkware force-pushed the 04-17-feat_apollo_infra_utils_better_cairo0_compiler_checks branch from 6bd0ed0 to f74618c Compare May 6, 2025 14:26
@dorimedini-starkware dorimedini-starkware force-pushed the 04-13-chore_apollo_infra_utils_explicit_instructions_in_verify_cairo0_compiler_deps branch from af8f488 to 2bc129a Compare May 6, 2025 14:52
@dorimedini-starkware dorimedini-starkware force-pushed the 04-17-feat_apollo_infra_utils_better_cairo0_compiler_checks branch from f74618c to 57b6dfc Compare May 6, 2025 14:52
@dorimedini-starkware dorimedini-starkware force-pushed the 04-13-chore_apollo_infra_utils_explicit_instructions_in_verify_cairo0_compiler_deps branch from 2bc129a to 132fd48 Compare May 8, 2025 09:22
@dorimedini-starkware dorimedini-starkware force-pushed the 04-17-feat_apollo_infra_utils_better_cairo0_compiler_checks branch from 57b6dfc to 85ce43a Compare May 8, 2025 09:22
@dorimedini-starkware dorimedini-starkware force-pushed the 04-13-chore_apollo_infra_utils_explicit_instructions_in_verify_cairo0_compiler_deps branch from 132fd48 to a343b0e Compare May 8, 2025 09:52
@dorimedini-starkware dorimedini-starkware force-pushed the 04-17-feat_apollo_infra_utils_better_cairo0_compiler_checks branch from 85ce43a to 6e5b341 Compare May 8, 2025 09:52
@dorimedini-starkware dorimedini-starkware force-pushed the 04-13-chore_apollo_infra_utils_explicit_instructions_in_verify_cairo0_compiler_deps branch from a343b0e to 9a3edd3 Compare May 8, 2025 16:12
@dorimedini-starkware dorimedini-starkware force-pushed the 04-17-feat_apollo_infra_utils_better_cairo0_compiler_checks branch from 6e5b341 to 0b00ce2 Compare May 8, 2025 16:12
@dorimedini-starkware dorimedini-starkware force-pushed the 04-13-chore_apollo_infra_utils_explicit_instructions_in_verify_cairo0_compiler_deps branch from 9a3edd3 to a780f22 Compare May 8, 2025 17:35
@dorimedini-starkware dorimedini-starkware force-pushed the 04-17-feat_apollo_infra_utils_better_cairo0_compiler_checks branch from 0b00ce2 to 5bf93a6 Compare May 8, 2025 17:35
@github-actions

github-actions Bot commented May 8, 2025

Copy link
Copy Markdown

Benchmark movements:
tree_computation_flow performance regressed!
tree_computation_flow time: [35.765 ms 36.274 ms 36.874 ms]
change: [+1.1871% +2.6402% +4.3655%] (p = 0.00 < 0.05)
Performance has regressed.
Found 11 outliers among 100 measurements (11.00%)
3 (3.00%) high mild
8 (8.00%) high severe

@dorimedini-starkware dorimedini-starkware force-pushed the 04-13-chore_apollo_infra_utils_explicit_instructions_in_verify_cairo0_compiler_deps branch from a780f22 to 400f179 Compare May 9, 2025 09:34
@dorimedini-starkware dorimedini-starkware force-pushed the 04-17-feat_apollo_infra_utils_better_cairo0_compiler_checks branch from 5bf93a6 to fd328a2 Compare May 9, 2025 09:34
@dorimedini-starkware dorimedini-starkware force-pushed the 04-13-chore_apollo_infra_utils_explicit_instructions_in_verify_cairo0_compiler_deps branch from 400f179 to 9477f04 Compare May 11, 2025 09:49
@dorimedini-starkware dorimedini-starkware force-pushed the 04-17-feat_apollo_infra_utils_better_cairo0_compiler_checks branch from fd328a2 to 94eb0ff Compare May 11, 2025 09:49
@dorimedini-starkware dorimedini-starkware force-pushed the 04-13-chore_apollo_infra_utils_explicit_instructions_in_verify_cairo0_compiler_deps branch from 9477f04 to 7243c38 Compare May 11, 2025 11:12
@dorimedini-starkware dorimedini-starkware force-pushed the 04-17-feat_apollo_infra_utils_better_cairo0_compiler_checks branch from 94eb0ff to b9541ed Compare May 11, 2025 11:12

@amosStarkware amosStarkware left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 4 of 5 files at r4, all commit messages.
Reviewable status: 4 of 5 files reviewed, 2 unresolved discussions (waiting on @Itay-Tsabary-Starkware and @TzahiTaub)


crates/apollo_infra_utils/src/cairo0_compiler.rs line 16 at r4 (raw file):

pub const STARKNET_COMPILE_DEPRECATED: &str = "starknet-compile-deprecated";
pub const CAIRO0_COMPILE: &str = "cairo-compile";
pub const EXPECTED_CAIRO0_VERSION: &str = "0.14.0a1";

why is it hardcoded here?

Code quote:

pub const EXPECTED_CAIRO0_VERSION: &str = "0.14.0a1";

crates/apollo_infra_utils/src/cairo0_compiler.rs line 32 at r4 (raw file):

pub fn cairo0_compilers_correct_version() -> Result<(), Cairo0CompilerVersionError> {
    for compiler in [CAIRO0_COMPILE, STARKNET_COMPILE_DEPRECATED] {

why are there now two compilers?

Code quote:

for compiler in [CAIRO0_COMPILE, STARKNET_COMPILE_DEPRECATED] {

@dorimedini-starkware dorimedini-starkware left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 4 of 5 files reviewed, 2 unresolved discussions (waiting on @amosStarkware, @Itay-Tsabary-Starkware, and @TzahiTaub)


crates/apollo_infra_utils/src/cairo0_compiler.rs line 16 at r4 (raw file):

Previously, amosStarkware wrote…

why is it hardcoded here?

easier to reference it; it's tested for consistency with the pip requirements in test_cairo0_version_pip_requirements


crates/apollo_infra_utils/src/cairo0_compiler.rs line 32 at r4 (raw file):

Previously, amosStarkware wrote…

why are there now two compilers?

one for cairo0 code, and one for cairo0 starknet contracts. they are separate scripts

@amosStarkware amosStarkware left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 5 files at r4, 2 of 2 files at r5, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @TzahiTaub)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants